home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programmer Plus 2007
/
Programmer-Plus-2007.iso
/
Programming
/
Student most wanted Languages
/
Turbo C v3.0
/
Tc3setup.exe
/
EXAMPLES
/
INTRO35.CPP
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1992-02-18
|
401 b
|
23 lines
//INTRO35.CPP--Example from Chapter 3, "An Introduction to C++"
#include <iostream.h>
void swap(int *, int *); // This is swap's prototype
int main()
{
int x = 5, y = 7;
swap(&x, &y);
cout << "\n x is now "<< x << " and y is now " << y << '\n';
return 0;
}
void swap(int *a, int *b) // swap is actually defined here
{
int temp;
temp = *a;
*a = *b;
*b = temp;
}